1. Field of the Invention
The present invention relates generally to improvements in data transfer systems and, more particularly but not by way of limitation, to improvements in apparatus for controlling the transfer of data between a host computer and discs of a hard disc drive.
2. Brief Description of the Prior Art
In a hard disc drive, files used by a host computer are stored on rotating discs on which are defined a series of concentric data tracks to which data contained in the files is written and from which the data is subsequently read. To this end, the discs are provided with magnetizable surface coatings, and a read/write head capable of magnetizing the surface in either of the two opposite directions along a track is provided for each disc surface to write the data to a selected track in the form of a series of magnetized cells along the track. Data is then recovered, or read, by the generation of emf pulses in the read/write head as boundaries between cells pass the head.
The data in a file is made up of a series of data characters, each corresponding to a particular pattern of bits, so that, at a microscopic level, the cells along a data track correspond generally to the series of bits that make up the individual characters of which a file is composed. (As is known in the art, the data is encoded prior to writing so that the correspondence is only a general one and the stream of emf pulses issuing from the read/write head is similarly decoded to recover the original bits of the data characters.) Thus, at a microscopic level, data in a file is corresponded to magnetized cells along a data track when a file is stored.
At a macroscopic level, the tracks are organized into sectors, each containing a header that identifies the sector, in which a selected number, usually 512, of data bytes are stored. Thus, when a file is be stored, it is divided into data sectors, corresponding to the sectors on the discs, and each data sector is stored at a selected sector on a disc. Thus, at the macroscopic level, reading and writing of files is effected on a sector basis and a file allocation table on the disc maintains a record of the disc sectors at which the file is located.
The transfer of a file between the host and a disc of the disc drive is similarly controlled at two levels, the microscopic level in which cells along a track on a disc are magnetized in relation to the bit structure of the file for subsequent reading and the macroscopic level in which sectors are selected to contain the data sectors into which the file is divided, and sectors of data are channeled to the selected sectors along a track of the disc. To implement this bi-level transfer scheme, a disc drive includes a buffer into which sectors of data are first transferred, either from the host or the disc, and from which the sectors of data are subsequently transferred to the disc or the host. Specifically, a system microprocessor, which is programmed to control the operation of the disc drive as a whole, includes programming for locating sectors at which a file is to be stored or from which a file is to be retrieved and for controlling the transfers at the sector level. At the microscopic, or character, level, transfers are carried out by hardware controllers that include state machines that control transfers of data to and from the buffer on a character by character basis.
Typically, then, transfers of files between the host and discs of the disc drive are carried out in a series of steps under the overall control of the system microprocessor but under microscopic control of the controllers. Thus, for example, at such times that a file is to be written to a disc, the host will provide general information to the system microprocessor, via a host interface controller, that will enable the system microprocessor to determine the sectors to which a file is to be written, and the system microprocessor initiates the transfer by carrying out a series of operations effecting transfer at the sector level. These operations include the issuance of commands to a servo system which controls the radial location of the read/write heads to cause movement of the heads to the track on the disc that is to receive the file and the selection of a segment of the buffer which is to be utilized in the transfer of the file to the disc sectors. Generally, the buffer segment is organized as a circular register which can contain a selected number of sectors, and sector length blocks within the buffer segment are reused once data stored in a block has been transferred from the buffer. Once these operations are complete, the system microprocessor transmits transfer control parameters to the host interface controller and issues a command to the host interface controller to transfer one or more sectors of data to the buffer segment. The state machine of the host interface controller then coacts with the host and a buffer controller, which provides microscopic control over the buffer, to cause the characters which comprise the file to be transferred into the sector blocks within the buffer segment.
Once the read/write head reaches the track that contains the sectors that are to receive the file, the microprocessor similarly issues commands and control parameters to a disc interface controller to cause sectors of data that have been stored in the buffer segment to be transferred, a bit at a time, to the appropriate sectors on the disc. More particularly, the disc interface controller, like the host interface controller, receives commands calling for the transfer of a selected number of sectors from the buffer segment to a read/write circuit which carries out the magnetization of cells along the data tracks.
Reading of a file is carried out in a similar manner. As in the case of writing, the system microprocessor will select a buffer segment to temporarily store data as it is read from a disc and will issue commands to the disc drive servo system to bring the read/write head into radial alignment with the track that contains the sectors at which the file is stored. Once these preliminary steps have been completed, the system microprocessor issues commands and control parameters to the disc interface controller to transfer one or more sectors from the disc to the buffer segment and subsequently issues commands to the host interface controller to transfer these sectors of data from the buffer segment to the host.
As will be clear from the above description of reading and writing, the system microprocessor must maintain a record of the number of sectors that have been transferred into and out of the buffer segment. For example, should the buffer segment become filled to capacity, further transfer of data into the buffer segment would result in overwriting of blocks of data that have not yet been transferred from the buffer segment. Similarly, issuance of a command to transfer data from the buffer segment after all blocks that have been transferred to the buffer segment have already been transferred from the buffer segment would result in the transfer of previously transferred data. In the first case, portions of a file would be deleted, and in the latter case unwanted insertions would be included in the file.
The maintenance of a record of sector transfers is accomplished by the issuance of commands to the controllers to transfer a selected number of sectors of data and by the use of interrupts of the system microprocessor when such number of sectors have been transferred. Thus, the host and disc interfaces generally comprise counting circuits which count the number of data transfers that have been made to or from the buffer segment and an interrupt generator that generates an interrupt to the system microprocessor when the selected number of sectors have been transferred. More particularly, the state machines in the interface controllers receive signals from the counting circuits each time a sector is transferred and are "programmed" by the selection of the truth table of decoders they contain to provide status signals to an interrupt generator indicative of the number of sectors that have been transferred. The interrupt generators then issue the interrupts to the system microprocessor.
While this general scheme of effecting data transfers between the host and discs of a disc drive provides an effective means of implementing the storage and retrieval of data files, problems have arisen with the use of the system microprocessor to orchestrate the transfers of sectors of data into and out of the buffer segment. Initially, as is known in the art, microprocessors operate very slowly in comparison with the rate at which data transfers are made at the character, or microscopic, level. In the time required for the system microprocessor to execute one program instruction, many characters of data are transferred into and out of the buffer segment. Such high speed transfer at the character level is necessary in order to effect the storage or retrieval of a file in a time that is acceptable to the users of computers and is the reason for the use of hardware controllers to control the transfer of data at the character level. Unlike a microprocessor, programming of a state machine is implemented in a decoder, rather than in a memory device, so that the state machine can be caused to have a limited number of functions which are performed in only a few clock cycles. Thus, the state machine operates at a rate that is comparable to the time required to magnetize a cell along a data track and can be used to control microscopic level data transfers.
Because of the relatively slow operation of the microprocessor, a decision must be made by the microprocessor at a time that is considerably in advance of the time that a sector on a disc that is to receive data from the buffer segment or that is to provide a source of data to be transferred to the buffer segment reaches the read/write head by means of which data is magnetically read from or written to the track. Typically, unless the microprocessor has received signals indicative of the presence of a sector of data in the buffer to be written to a disc or the presence of a free block to receive a sector in the buffer segment by the time the previous sector along the track has reached the read/write head, it will not have time to issue the necessary commands to the disc interface controller to transfer data to or from the disc. Commonly, the disc interface controller contains circuitry for reading sector headers and comparing them with header identification codes supplied by the system microprocessor and reporting to the disc interface controller state machine when the previous sector header has been read. The state machine is programmed to respond to such report by providing a status code to the interrupt generator that results in an interrupt of the system microprocessor which then reads the status code and determines, while such previous sector is passing the read/write head, whether a sector of data is available to be written to the disc or whether a sector length block is available in the buffer to receive data from disc. If not, no command to transfer a sector of data will be issued to the disc interface controller. Thus, even though a sector to be written to a disc may be in the buffer segment or space to receive data from the disc may be available in the buffer at the time that the sector actually reaches the read/write head, writing or reading, as the case may be, will, perforce, be suspended for the time required for the disc to make a complete revolution to return the sector next to receive or provide data to the read/write head. Such a suspension will unduly lengthen the time required to store a file to a disc or retrieve a file from a disc.
An additional problem with microprocessor intervention each time one or only few sectors are transferred into or out of the buffer segment is the amount of microprocessor operating time that must be allocated to the transfer of data between the disc and the host. As can be seen from the above, each time either interface controller reports the completion of the transfer of a sector, or a few sectors, of data to or from the buffer segment, the system microprocessor must execute an interrupt routine that will determine whether additional sectors can be transferred into or out of the buffer sector and cause the microprocessor to issue commands to transfer additional sectors. Since the system microprocessor provides overall control of the disc drive, the time required for executing these interrupt routines can limit the capabilities of the disc drive solely on the basis that the microprocessor processing time is not available to carry out functions required to provide additional capabilities. Thus, while the general scheme for effecting data transfers between a host and a disc is, in principle, an effective approach to data storage and retrieval, the implementation of the scheme has given rise to practical problems that have not heretofore been solved.